package com.zhangshihao.controller;

import com.zhangshihao.domain.Book;
import com.zhangshihao.service.IBookService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/book")

public class BookController {
    @Autowired
    private IBookService bookService;

@PostMapping("/list")
    public List<Book> findAll(@RequestBody Book book){
        return bookService.getAllBooks(book);
    }
}
